package com.es.test;

/**
 * @author django
 * @date 2024/1/31
 * @description TODO
 */
import java.util.concurrent.CompletableFuture;

public class AsyncExample {

    public static void main(String[] args)   {
        CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> "Hello");

        // 异步操作完成后执行的操作
        future.thenAccept(result -> System.out.println("Result: " + result));

    }
}
